<template>
  <!-- 项目信息详情 -->
  <div class="app-container-detail">
    <!-- 功能按钮 -->
    <el-row :gutter="10" class="button-wrap" :style="{width:mainContentWidth + 'px','left':'80px'}">
      <el-col :span="1.5">
        <el-button icon="el-icon-arrow-left" size="small" @click="handleReturn()">返回</el-button>
      </el-col>
      <!-- <el-col v-if="!isShow" :span="1.5">
        <el-button v-clickForbidden icon="el-icon-document-checked" size="small" @click="handleComfig(true)">确认</el-button>
      </el-col>
      <el-col v-if="!isShow" :span="1.5">
        <el-button v-clickForbidden icon="el-icon-document-checked" size="small" @click="handleComfig()">拒绝</el-button>
      </el-col> -->
    </el-row>
    <!-- form表单 -->
    <div class="main-content">
      <el-card ref="mainContent" class="box-card" shadow="never">
        <div slot="header">
          <span>项目信息详情</span>
        </div>
        <div class="main-content-body">
          <div class="detail-item">
            <!--基本信息-->
            <div ref="baseInfo" class="two-level-title">基本信息</div>
            <table class="detail-table" cellpadding="0" cellspacing="0">
              <tr>
                <td>
                  <span class="labelTitle">项目名称</span>
                </td>
                <td colspan="3">
                  <span class="infoText">{{ formData.proName }}</span>
                </td>
                <td>
                  <span class="labelTitle">项目代码</span>
                </td>
                <td>
                  <span class="infoText">{{ formData.proCode }}</span>
                </td>
                <td>
                  <span class="labelTitle">项目编号</span>
                </td>
                <td>
                  <span class="infoText">{{ formData.proNum }}</span>
                </td>
              </tr>
              <tr>
                <td>
                  <span class="labelTitle">建字第号</span>
                </td>
                <td colspan="3">
                  <span class="infoText">{{ formData.buildManagementNum }}</span>
                </td>
                <td>
                  <span class="labelTitle">项目等级</span>
                </td>
                <td>
                  <span class="infoText">{{ formData.grade }}</span>
                </td>
                <td>
                  <span class="labelTitle">项目类型</span>
                </td>
                <td>
                  <span class="infoText">{{ formData.proTypeName }}</span>
                </td>
                <!-- <td>
                  <span class="labelTitle">合同金额</span>
                </td>
                <td>
                  <span class="infoText">{{ formData.contractAmountComdify }}万元</span>
                </td> -->
              </tr>
              <tr>
                <td>
                  <span class="labelTitle">钻孔总数</span>
                </td>
                <td>
                  <span class="infoText">{{ formData.drillingCount }}个</span>
                </td>
                <td>
                  <span class="labelTitle">钻孔总延米</span>
                </td>
                <td>
                  <span class="infoText">{{ formData.drillMember }}m</span>
                </td>
                <td>
                  <span class="labelTitle">所在区域</span>
                </td>
                <td colspan="3">
                  <span class="infoText">{{ currentProvince }}</span>
                </td>
              </tr>
              <tr>
                <td>
                  <span class="labelTitle">项目地址</span>
                </td>
                <td colspan="3">
                  <span class="infoText">{{ formData.address }}</span>
                </td>
                <td>
                  <span class="labelTitle">坐标经度</span>
                </td>
                <td>
                  <span class="infoText">{{ formData.x1 }}</span>
                </td>
                <td>
                  <span class="labelTitle">坐标纬度</span>
                </td>
                <td>
                  <span class="infoText">{{ formData.y1 }}</span>
                </td>
              </tr>
              <tr>
                <td>
                  <span class="labelTitle">地貌类型</span>
                </td>
                <td>
                  <span class="infoText">{{ formData.regionTypeName }}</span>
                </td>
                <td>
                  <span class="labelTitle">计划时间</span>
                </td>
                <td colspan="3">
                  <span class="infoText">{{ formData.startTime }} - {{ formData.endTime }}</span>
                </td>
                <!--<td>
                  <span class="labelTitle" v-html="`高&ensp;程&ensp;(m)`" />
                </td>
                <td>
                  <span class="infoText">{{ formData.z }}</span>
                </td>-->
                <td>
                  <span class="labelTitle">建筑规模</span>
                </td>
                <td>
                  <span class="infoText">{{ formData.scale }}㎡</span>
                </td>

              </tr>
              <tr>
                <td>
                  <span class="labelTitle" v-html="`备&emsp;&emsp;注`" />
                </td>
                <td colspan="7">
                  <span class="infoText">{{ formData.remark }}</span>
                </td>
              </tr>
              <tr>
                <td>
                  <span class="labelTitle" v-html="`规&ensp;划&ensp;证`" />
                </td>
                <td colspan="7">
                  <previewImg :img-id-list="landUsePermitList" />
                </td>
              </tr>
            </table>
            <!--项目合同-->
            <div class="detail-item marginT10">
              <div ref="ProjectContract" class="two-level-title">项目合同</div>
              <Contract :pro-id="proId" />
            </div>
            <!--项目备案-->
            <div class="detail-item marginT10">
              <div ref="ProjectFiling" class="two-level-title">项目备案</div>
              <table class="detail-table" cellpadding="0" cellspacing="0">
                <tr>
                  <td>
                    <span class="labelTitle">备案日期</span>
                  </td>
                  <td>
                    <span class="infoText">{{ ProjectFiling.recordStartDate }} - {{ ProjectFiling.recordEndDate }}</span>
                  </td>
                  <td>
                    <span class="labelTitle">备案地区</span>
                  </td>
                  <td>
                    <el-cascader
                      v-model="ProjectFiling.regaionList"
                      disabled
                      size="medium"
                      placeholder="请选择所在地区"
                      :options="cityOptions"
                      clearable
                      style="width: 100%"
                    >
                      <template slot-scope="{ data }">
                        <span>{{ data.label }}</span>
                      </template>
                    </el-cascader>
                  </td>
                  <td>
                    <span class="labelTitle">详细地址</span>
                  </td>
                  <td colspan="3">
                    <span class="infoText">{{ ProjectFiling.address }}</span>
                  </td>
                </tr>
                <tr>
                  <td>
                    <span class="labelTitle">备案说明</span>
                  </td>
                  <td colspan="7">
                    <span class="infoText">{{ ProjectFiling.recordExplain }}</span>
                  </td>
                </tr>
              </table>
              <FileUplode
                ref="fileUplode"
                :edit-file-list="filingList"
                :read-only="isReadonly"
                @getFileList="getFiling"
              />
            </div>
            <!--项目附件上传-->
            <div class="detail-item marginT10">
              <div ref="ProFile" class="two-level-title">项目附件</div>
              <proFile />
            </div>
            <!--试验委托单-->
            <div class="detail-item marginT10">
              <div ref="assignCompany" class="two-level-title">试验委托单</div>
              <assignCompany :pro-id="proId" :pro-name="formData.proName" />
            </div>
            <!--勘探点信息-->
            <div class="detail-item marginT10">
              <div ref="ExplorationPointInfo" class="two-level-title">勘探点信息</div>
              <el-tabs v-model="activeName">
                <el-tab-pane :label="`全部(${tableData.length})`" name="first">
                  <ExplorationPointTable :pro-name="formData.proName" :table-data="tableData" />
                </el-tab-pane>
                <el-tab-pane :label="`未开始(${notStartList.length})`" name="second">
                  <ExplorationPointTable :pro-name="formData.proName" :table-data="notStartList" />
                </el-tab-pane>
                <el-tab-pane :label="`进行中(${inProgressList.length})`" name="third">
                  <ExplorationPointTable :pro-name="formData.proName" :table-data="inProgressList" />
                </el-tab-pane>
                <el-tab-pane :label="`已完成(${completedList.length})`" name="fourth">
                  <ExplorationPointTable :pro-name="formData.proName" :table-data="completedList" />
                </el-tab-pane>
              </el-tabs>
            </div>
            <!--项目已分配人员-->
            <div class="detail-item marginT10">
              <div ref="AssignedPersonnel" class="two-level-title">项目已分配人员</div>
              <AssignedPersonnel :pro-id="proId" />
            </div>
            <!--项目已分配设备-->
            <div class="detail-item marginT10">
              <div ref="AllocatedDevices" class="two-level-title">项目已分配设备</div>
              <AllocatedDevices :pro-id="proId" />
            </div>
            <!--巡检单位-->
            <div class="detail-item marginT10">
              <div ref="PatrolEnterprise" class="two-level-title">巡检单位</div>
              <PatrolEnterprise :pro-id="proId" />
            </div>
            <!--巡检人员-->
            <div class="detail-item marginT10">
              <div ref="PatrolPersonnel" class="two-level-title">巡检人员</div>
              <PatrolPersonnel :pro-id="proId" />
            </div>
            <!--巡检记录-->
            <div class="detail-item marginT10">
              <div ref="PatrolRecord" class="two-level-title">巡检记录</div>
              <PatrolRecord :pro-id="proId" />
            </div>
            <!--建筑物-->
            <div ref="buildingInfo" class="data-form-item marginT10">
              <buildingInfo :read-only="true" :table-data="BuildingList" @getTableFormData="getTableDuilding" />
            </div>
            <!--供应商单位-->
            <div class="data-form-item">
              <div ref="supplier" class="two-level-title">供应商</div>
              <companyDefinite
                v-for="(item, index) in organizationList"
                :key="index"
                :read-only="true"
                :class="{marginT10: index !==0}"
                :company-title="item.typeName"
                :company-type="item.typeNum"
                :company-index="index"
                :table-data.sync="organizationListData[item.typeNum]"
                @getTableFormData="getTableFormData"
              />
            </div>
          </div>
        </div>
      </el-card>
    </div>
    <!--侧边快捷导航-->
    <aside class="project-aside">
      <div v-if="switchShow">
        <p v-for="(item,index) in targetList" :key="index" :class="{isActive: index === lightIndex}" class="scroll-item" @click="goPosition(item.refName)">
          <i class="icon el-icon-place" />
          <span>{{ item.text }}</span>
        </p>
      </div>
      <div>
        <p class="scroll-item switch" @click="handleSwitch">
          <i :class="switchShow ? 'el-icon-arrow-down':'el-icon-arrow-up'" />
          <span>{{ switchShow? '收起': '展开' }}</span>
        </p>
      </div>
    </aside>

  </div>
</template>
<script>
/** 页面接口 start*/
import {
  superviseDistributionSurvey,
  surveyUnitDistributionPerson,
  responsibleDept,
  deptDistributionPerson
} from '@/api/common/approvalReminder'
import { listByTreeProcessType } from '@/api/common/area.js'
import { getSupplier, getBuilding, getExplorationPoint, getBasicInfo, enterpriseApi } from '@/api/projectManage/project'
/** 页面接口 end*/

/** 页面组件 start*/
// 项目附件
import proFile from './proFile'
// 项目合同
import Contract from '@/components/basicinfo/Contract'
// 试验委托单
import assignCompany from '@/components/basicinfo/assignCompany'
// 已分配设备
import AllocatedDevices from '@/components/basicinfo/AllocatedDevices'
// 已分配人员
import AssignedPersonnel from '@/components/basicinfo/AssignedPersonnel'
// 巡检单位
import PatrolEnterprise from './PatrolEnterprise'
// 巡检人员
import PatrolPersonnel from './PatrolPersonnel'
// 巡检记录
import PatrolRecord from './PatrolRecord'
// 单位明细
import companyDefinite from './companyDefinite'
// 建筑明细
import buildingInfo from './buildingInfo'
// 图片上传
import previewImg from '@/components/basicinfo/previewImg'
// 勘探点表格
import ExplorationPointTable from '@/components/basicinfo/ExplorationPointTable'
// 字段校验
import { divideMoneyWan } from '@/utils/validate'
// 项目合同
import { getContractById } from '@/api/projectManage/project/proContract'
// 项目备案
import { getProFilingById } from '@/api/projectManage/project/projectFiling'
// 上传文件
import FileUplode from '@/components/Upload/FileUplode'
import { mapState } from 'vuex'
/** 页面组件 end*/
export default {
  components: {
    proFile,
    Contract,
    assignCompany,
    companyDefinite,
    buildingInfo,
    previewImg,
    ExplorationPointTable,
    AllocatedDevices,
    AssignedPersonnel,
    PatrolEnterprise,
    PatrolPersonnel,
    PatrolRecord,
    FileUplode
  },
  data() {
    return {
      switchShow: true, // 侧边导航展开
      mainContentWidth: '',
      targetList: [
        { text: '基本信息', refName: 'baseInfo' },
        { text: '项目合同', refName: 'ProjectContract' },
        { text: '项目备案', refName: 'ProjectFiling' },
        { text: '项目附件', refName: 'ProFile' },
        { text: '试验委托单', refName: 'assignCompany' },
        { text: '勘探点信息', refName: 'ExplorationPointInfo' },
        { text: '项目已分配人员', refName: 'AssignedPersonnel' },
        { text: '项目已分配设备', refName: 'AllocatedDevices' },
        { text: '巡检单位', refName: 'PatrolEnterprise' },
        { text: '巡检人员', refName: 'PatrolPersonnel' },
        { text: '巡检记录', refName: 'PatrolRecord' },
        { text: '建筑物', refName: 'buildingInfo' },
        { text: '供应商', refName: 'supplier' }
      ],
      msgType: '', // 消息类型
      // 未开始钻孔
      notStartList: [],
      // 进行中钻孔
      inProgressList: [],
      // 已完成钻孔
      completedList: [],
      tableData: [],
      activeName: 'first',
      readOnly: true,
      formData: {
        proName: '', // 项目名称
        proCode: '', // 项目代码
        proNum: '', // 项目编号
        buildManagementNum: '', // 建字第号
        grade: '', // 项目等级
        contractAmountComdify: '', // 合同金额带逗号分割
        contractAmount: '', // 合同金额
        drillingCount: '', // 钻孔总个数
        drillMember: '', // 钻孔总延米
        currentProvince: '', // 所在区域
        nation: '', // 国家
        region: '', // 地区
        province: '', // 省
        city: '', // 市
        county: '', // 县
        address: '', // 项目地址
        x: 0, // 坐标经度
        y: 0, // 坐标纬度
        regionTypeId: '', // 地貌类型
        regionTypeName: '', // 地貌类型名称
        z: 0, // 高程
        scale: '', // 建筑规模
        startTime: '', // 计划开始时间
        endTime: '', //  计划结束时间
        remark: '', // 备注
        /* 附件 end */
        buildList: '', // 建筑物
        proEnterpriseList: '' // 供应商单位列表
      },
      cityOptions: [],
      currentProvince: '',
      /* 附件 start*/
      projectFileList: [], // 项目附件
      landUsePermitList: [], // 土地规划许可证附件
      /* 附件 end*/
      /* 单位 start*/
      BuildingList: [], // 建筑列表
      organizationList: [], // 动态单位类型
      organizationListData: {}, // 动态单位数据
      /* 单位 end*/
      lightIndex: 0,
      timer: null,
      appMain: null,
      // 项目合同
      isReadonly: false,
      conractFileList: [], // 回显合同
      formContract: {
        id: '',
        proId: '', // 项目id
        contractName: '', // 合同名称
        construction: '', // 建设单位
        contractPriceName: '',
        contractPrice: '', // 合同单价
        contractDuration: '', // 合同工期
        contractAmountName: '',
        contractAmount: '', // 合同总金额
        drillingCount: '', // 钻孔总个数
        drillMember: '', // 钻孔总米数
        minScope: '', //  勘探最小深度
        maxScope: '', // 勘探最大深度
        appFiles: '', // 合同附件
        fileDelete: ''
      },
      // 项目备案
      ProjectFiling: { // 新增数据
        id: '', // 项目id
        recordType: '0',
        recordTime: '', // 备案时间
        recordStartDate: '',
        recordEndDate: '',
        regaionList: '',
        address: '',
        recordExplain: '',
        appFiles: ''
      },
      ProjectFilingProvince: '',
      filingList: []// 附件
    }
  },
  computed: {
    ...mapState({
      proGrade: state => state.basicInfo.proGrade, // 项目等级
      proId: state => state.basicInfo.proId // 项目id
    }),
    isShow() {
      // 1.为空 或 061、052 062 不审批
      const isCode = ['052', '061', '062'].includes(this.msgType)
      return isCode
    }
  },
  mounted() {
    /** 获取主题内容宽度 start*/
    setTimeout(() => {
      this.mainContentWidth = this.$refs.mainContent.$el.offsetWidth
    }, 100)
    const that = this
    window.onresize = () => {
      return (() => {
        that.mainContentWidth = that.$refs.mainContent.$el.offsetWidth
      })()
    }
    /** 获取主题内容宽度 end*/

    const { msgType } = this.$route.query
    if (msgType === '011' || msgType === '012') {
      this.msgType = ''
    } else {
      this.msgType = msgType
    }
    // 动态供应商单位
    this.enterpriseApi()
    if (this.$route.query.proId) this.$store.commit('basicInfo/SET_ProId', this.$route.query.proId)
    this.$nextTick(() => {
      this.handleUpdate(this.proId)
    })

    this.appMain = document.querySelector('.app-main')
    // 滚动区域的元素绑定scroll
    this.appMain.addEventListener('scroll', this.throttle(this.lightText, 200))

    // 获取项目合同详情
    this.handleContractDetail(this.proId)

    // 获取项目备案详情
    this.getDetailById(this.proId)
  },
  beforeDestroy() {
    this.appMain.removeEventListener('scroll', this.lightText)
  },
  methods: {
    // 侧边导航展开关闭
    handleSwitch() {
      this.switchShow = !this.switchShow
    },
    lightText(e) {
      this.targetList.forEach((item, index) => {
        // 当前元素的top
        const el = this.$refs[item.refName]
        if (el) {
          const top = el.offsetTop
          // 首个item的top
          const firstTop = this.$refs[this.targetList[0].refName].offsetTop
          // 滚动条距离 >= 当前元素 - 第一个元素高度
          const flag = e.target.scrollTop >= top - firstTop
          flag && (this.lightIndex = index)
        }
      })
    },
    throttle(func, wait) {
      let timer
      return function() {
        if (timer) clearTimeout(timer)
        timer = setTimeout(() => {
          func.apply(this, arguments)
        }, wait)
      }
    },
    goPosition(refName) {
      // 滚动条所在元素
      const appMain = document.querySelector('.app-main')
      // 当前200 目标500
      // 向下滚动 (200-500)  -300

      // 获取定位元素距离顶部的top
      const targetTop = this.$refs[refName].offsetTop - 40
      appMain.scrollTop = targetTop
    },
    // 确认按钮
    handleComfig(isAgree) {
      const status = isAgree ? '0' : '1'
      const { userId, proId, enterpriseId, nodeId } = this.$route.query
      switch (this.msgType) {
        case '051': // 监管分配勘察单位
          this.approvalReminder(isAgree, superviseDistributionSurvey, { userId, enterpriseId, status })
          break
        case '052': // 勘察单位指定人员
          this.approvalReminder(isAgree, surveyUnitDistributionPerson, { proId, userId, confirm: status })
          break
        case '061': // 责任部门
          this.approvalReminder(isAgree, responsibleDept, { proId, nodeId, status })
          break

        case '062': // 部门分人
          this.approvalReminder(isAgree, deptDistributionPerson, { proId, nodeId, status })
          break
      }
    },
    // 审批
    approvalReminder(isAgree, methodName, params) {
      if (isAgree) {
        this.$confirm('是否同意审批?', '提示', {
          confirmButtonText: '同意',
          cancelButtonText: '取消'
        }).then(async() => { // 同意审批
          const { code } = await methodName(params)
          if (code === 200) {
            this.msgSuccess('审批成功')
            this.$router.go(-1)
          }
        }).catch(() => {})
      } else { // 审批被拒绝
        this.$prompt('请输入拒绝理由', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消'
        }).then(async({ value }) => {
          const { code } = await methodName({ ...params, reason: value })
          if (code === 200) {
            this.msgWarning('审批失败')
            this.$router.go(-1)
          }
        }).catch(() => {})
      }
    },
    // 项目等级翻译
    formatproGrade(proGrade) {
      return this.selectDictLabel(this.proGrade, proGrade)
    },
    // 查看钻孔详情
    handleExplorDetail(id) {
      this.$router.push({
        path: '/newProject/exploration-detail',
        query: { explorationId: id }
      })
    },
    // 获取勘探点列表
    getExploration(explorationList) {
      this.tableData = explorationList
      explorationList.forEach(item => {
        const status = item.status
        if (status === '1') this.inProgressList.push(item)
        else if (status === '0') this.notStartList.push(item)
        else if (status === '3') this.completedList.push(item)
      })
    },
    // 查询项目立项的详情
    async handleUpdate(id) {
      const { data } = await getBasicInfo(id)
      const { data: proEnterpriseList } = await getSupplier(id)
      const { data: buildList } = await getBuilding(id)
      const { data: explorationList } = await getExplorationPoint(id)
      this.formData = { ...data }
      // 项目等级
      this.formData.grade = this.formatproGrade(data.grade)
      // 合同金额千位分割
      this.formData.contractAmountComdify = this.formData.contractAmount + ''
      // 计划时间
      this.planTime = [data.startTime, data.endTime]
      // 合同金额千位分割
      this.formData.contractAmountComdify = divideMoneyWan(this.formData.contractAmount)
      // 地区回显
      this.getRegionTree()
      // 附件回显
      if (data.landUsePermitList) {
        this.landUsePermitList = data.landUsePermitList.map(item => item.fileId)
      }
      // 建筑物明细
      this.BuildingList = buildList
      // 勘探点列表
      this.getExploration(explorationList)
      // 动态供应商单位转为json
      const endData = this.handlerEnterpriseDatas(proEnterpriseList)
      if (endData.length > 0) {
        this.$nextTick(() => {
          endData.map(item => {
            this.organizationListData[item.sysEnterpriseType] = item.children
          })
        })
      }
    },
    // 处理返回的供应商
    handlerEnterpriseDatas(arr) {
      const tempArr = []
      const endData = []
      for (let i = 0; i < arr.length; i++) {
        if (tempArr.indexOf(arr[i].sysEnterpriseType) === -1) {
          endData.push({
            sysEnterpriseType: arr[i].sysEnterpriseType,
            children: [arr[i]]
          })
          tempArr.push(arr[i].sysEnterpriseType)
        } else {
          for (let j = 0; j < endData.length; j++) {
            if (endData[j].sysEnterpriseType === arr[i].sysEnterpriseType) {
              endData[j].children.push(arr[i])
              break
            }
          }
        }
      }
      return endData
    },
    /** 单位信息 start*/
    // 建筑物
    getTableDuilding(tableFormData) {
      this.formData.buildList = tableFormData
    },
    // 获取动态单位单位
    getTableFormData(tableFormData, companyType) {
      this.organizationListData[companyType] = tableFormData
    },
    // 获取动态供应商
    async enterpriseApi() {
      const { data: { rows }} = await enterpriseApi()
      this.organizationList = rows.filter(item => { return item.typeNum !== '04' })
      this.organizationList.map(item => {
        this.organizationListData[item.typeNum] = []
      })
    },
    /** 单位信息 end*/
    // 获取区域树
    async getRegionTree() {
      const { data: { rows }} = await listByTreeProcessType({ regionCode: '' })
      this.cityOptions = this.deleteChildren(rows)
      this.getRegionCode()
    },
    // 根据地区编码回显地区
    getRegionCode() {
      const { formData: { province, city, county }} = this
      if (!county) return
      const nation = this.cityOptions[0]
      const region = this.cityOptions[0].children.find(item => {
        return item.children && item.children.some(city => city.value === province)
      })
      const sheng = region.children.find(sheng => sheng.value === province)
      const shi = sheng.children.find(shi => shi.value === city)
      const xian = shi.children.find(xian => xian.value === county)
      this.currentProvince = (nation.label + region.label + sheng.label + shi.label + xian.label) || ''
    },
    // 返回
    handleReturn() {
      this.$router.go(-1)
    },
    /** 项目合同 start*/
    // 合同总金额
    contractAmount(e) {
      if (e) {
        this.formContract.contractAmountName = this.divideMoney(e, 6)
        this.formContract.contractAmount = e * 10000
      }
    },
    // 合同单价
    contractPrice(e) {
      if (e) {
        this.formContract.contractPriceName = this.divideMoney(e, 2)
        this.formContract.contractPrice = e
      }
    },
    // 获取合同附件
    getContractFile(fileList, deleteFileIds) {
      this.formContract.appFiles = fileList
      this.formContract.fileDelete = deleteFileIds
    },
    // 获取合同
    handleContractDetail(id) {
      getContractById(id).then(res => {
        if (res.data) {
          this.dialogTitle = '合同详情'
          this.isReadonly = true
          this.formContract = { ...res.data }
          this.formContract.contractAmountName = this.divideMoney(res.data.contractAmount, 6, true)
          this.formContract.contractPriceName = this.divideMoney(res.data.contractPrice, 2)
          if (res.data.appFiles && res.data.appFiles.length > 0) {
            this.conractFileList = res.data.appFiles
          }
        }
      })
    },
    /** 项目合同 end*/

    /** 项目备案 start*/
    // 查询备案的详情
    getDetailById(id) {
      getProFilingById(id).then(res => {
        if (res.data) {
          const { nation, region, province, city, county, appFiles } = res.data
          this.ProjectFiling = { ...this.ProjectFiling, ...res.data }
          this.ProjectFiling.regaionList = [nation, region, province, city, county]
          if (res.data.recordStartDate && res.data.recordEndDate) this.ProjectFiling.recordTime = [this.ProjectFiling.recordStartDate, this.ProjectFiling.recordEndDate]
          this.filingList = appFiles
          console.log(1, this.ProjectFiling)
        }
      })
    },
    getFiling(fileList, deleteFileIds) {
      this.ProjectFiling.appFiles = fileList
    }
    /** 项目备案 end*/

  }

}
</script>

<style lang="scss">
</style>

